function initEcharts(echartData) {
  var chartOneDom = document.getElementById("b-line");
    var chartOne = echarts.init(chartOneDom);

     var chartOneOption = {
        color: ['#4aa9e9','#eac459','red','brown'],

        tooltip : {
        	//鼠标悬浮显示的数据
            trigger: 'axis',
           formatter:function(params)    
           {    
		           var relVal = params[0].name+"号";    
		           for (var i = 0, l = params.length; i < l; i++) {    
		                relVal += '<br/>' + params[i].seriesName + ' : ' + params[i].value.replace(".",":");   
		            }    
		           return relVal;    
		    }    
        },
        legend: {
            data:['下班时间','上班时间']
        },

        calculable : true,
        xAxis : [
            {
                type : 'category',
                boundaryGap : false,
                data: echartData.dates
            }
        ],
        yAxis : [
            {
                type : 'value',
                name:'时间',
                min:6,
                max:23,
                splitNumber:18,
                axisLabel : {
                    formatter: '{value}:00'
                }
                
             
            }
        ],
        series : [
            {
                name:'下班时间',
                type:'line',
                data:echartData.signout,
                markPoint : {
                    data : [
                       {name : 'Min of Week', value : -2, xAxis: 1, yAxis: -1.5}
                    ]
                },
                markLine : {
                    data : [
                        {type : 'average', name: '下班平均时间'}
                    ]
                }
            },
            {
                name:'上班时间',
                type:'line',
                data:echartData.sign,
                markPoint : {
                    data : [
                        {name : 'Min of Week', value : -2, xAxis: 1, yAxis: -1.5}
                    ]
                },
                markLine : {
                    data : [
                        {type : 'average', name : '上班平均时间'}
                    ]
                }
            }
            
           
        ]
    };

    if (chartOneOption && typeof chartOneOption === "object") {
        chartOne.setOption(chartOneOption, true);
    }


   /**
     * Resize chart on window resize
     * @return {void}
     */
    window.onresize = function() {
        chartOne.resize();
        
    };

}
